package main

import (
	"encoding/json"
	"fmt"
)

type HelloTag struct {
	Name string `json:"name"`
	Age  int    `json:"age"`
}

func main() {

	a := HelloTag{
		"张三",
		22,
	}
	s, err := json.Marshal(a)

	if err != nil {
		fmt.Println(err)
	} else {
		fmt.Println(string(s))
	}

	var vvvv HelloTag
	err = json.Unmarshal(s, &vvvv)
	if err != nil {
		fmt.Println(err)
	}
	fmt.Println(vvvv)

}
